{if $status == 'C'}
<table align="center" width="80%">
<tr>
  <td class="table5" align="center" colspan="8"><B>List Of Created Final Master</B></td>
</tr>
<tr>
  <td class="table1" align="center">&nbsp;</td>
  <td class="table1" align="center"><B>Sr. No.</B></td>
  <td class="table1" align="center"><B>Customer</B></td>
	<td class="table1" align="center"><B>Challan No</B></td>
	<td class="table1" align="center"><B>Date</B></td>
	<td class="table1" align="center"><B>Challan Type</B></td>
  <td class="table1" align="left">SubCategory</td>
  <td class="table1" align="center">Item</td>
  <td class="table1" align="center">Quantity</td>
</tr>
{assign var="finalMaster" value="0"}
{section name="sec" loop=$deliveryChallanArray}
  {if $deliveryChallanArray[sec].display == 1}
	  {section name="sec1" loop=$deliveryDetailArray[sec]}
	    <tr>
	      {if $deliveryDetailArray[sec][sec1].rowCount == 0}
	        <input type="hidden" name="finalMaster" value="{$finalMaster++}">
	        <td class="table3" align="center" NOWRAP style="font-size:10px;">
	        	<a href="proforma.php?deliveryChallanMasterId={$deliveryChallanArray[sec].deliveryChallanMasterId}">
	        		Proceed For Bill
	        	</a>
	        </td>
		      <td class="table3" align="center">{$smarty.section.sec.rownum}</td>
		      <td class="table3" align="left">{$deliveryChallanArray[sec].companyName}</td>
		      <td class="table3" align="center">{$deliveryChallanArray[sec].srNo}</td>
		      <td class="table3" align="right">{$deliveryChallanArray[sec].dateMaster}</td>
		      <td class="table3" align="right">{$deliveryChallanArray[sec].challanType}</td>
	      {else}
		      <td class="table3" align="center">&nbsp;</td>
		      <td class="table3" align="center">&nbsp;</td>
		      <td class="table3" align="center">&nbsp;</td>
		      <td class="table3" align="center">&nbsp;</td>
		      <td class="table3" align="center">&nbsp;</td>
		      <td class="table3" align="center">&nbsp;</td>
	      {/if}
		      <td class="table3">{$deliveryDetailArray[sec][sec1].subCategoryName}</td>
		      <td class="table3" NOWRAP style="font-size:10px;">{$deliveryDetailArray[sec][sec1].itemName}</td>
		      <td class="table3" align="right">{$deliveryDetailArray[sec][sec1].quantity}</td>
	    </tr>
	 {/section}
  {/if}
  {/section}
  {if $finalMaster == 0}
  <tr><td align="center" colspan="10"> <h2><font color="red"><b>{$msg}</b></font></h2></td></tr>
  {/if}
</tr>
</table>
<br />
{/if}
{if $status == 'P'}
<table align="center" width="80%">
<tr>
  <td class="table4" align="center" colspan="7"><B>Pending Challans To Create Final Master</td>
</tr>
<tr>
  <td class="table1" align="center"><B>Sr. No.</td>
  <td class="table1" align="center"><B>Customer</td>
	<td class="table1" align="center"><B>Challan No</td>
	<td class="table1" align="center"><B>Challan Type</td>
  <td class="table1" align="left">SubCategory</td>
  <td class="table1" align="center">Item</td>
  <td class="table1" align="center">Quantity</td>
</tr>
{assign var="pendingMaster" value="0"}
{section name="secP" loop=$pendingDCArray}
  {if $pendingDCArray[secP].display == 1}
	    {section name="secP1" loop=$pendingDCDetailArray[secP]}
	      <tr>
	        {if $pendingDCDetailArray[secP][secP1].rowCount == 0}
	          <input type="hidden" name="pendingMaster" value="{$pendingMaster++}"> 
			      <td class="table3" align="center">{$smarty.section.secP.rownum}</td>
			      <td class="table3" align="left">{$pendingDCArray[secP].companyName}</td>
			      <td class="table3" align="center">{$pendingDCArray[secP].srNo}</td>
			      <td class="table3" align="right">{$pendingDCArray[secP].challanType}</td>
	        {else}
			      <td class="table3" align="center">&nbsp;</td>
			      <td class="table3" align="center">&nbsp;</td>
			      <td class="table3" align="center">&nbsp;</td>
			      <td class="table3" align="center">&nbsp;</td>
	       {/if}
		      <td class="table3">{$pendingDCDetailArray[secP][secP1].subCategoryName}</td>
		      <td class="table3" NOWRAP style="font-size:10px;">{$pendingDCDetailArray[secP][secP1].itemName}</td>
		      <td class="table3" align="right">{$pendingDCDetailArray[secP][secP1].quantity}</td>
	    </tr>
	    {/section}
  {/if}
{/section}
{if $pendingMaster == 0}
  <tr><td align="center" colspan="10"> <h2><font color="red"><b>{$msg}</b></font></h2></td></tr>
  {/if}
</tr>
</table>
{/if}